#ifndef __CODE2_COMP_H
#define __CODE2_COMP_H
				 
typedef enum
{			 
	COMP_R_HEAD1 					= 0,
	COMP_R_MOTION_MODE		= 1,
	COMP_R_CONT_DIS_L			= 2,
	COMP_R_CONT_DIS_H			= 3,	
	COMP_R_CONT_ANGLE_L		= 4,
	COMP_R_CONT_ANGLE_H		= 5,
	COMP_R_HEAD_MODE			= 6, 
	COMP_R_MOTOR_0_L			= 7,
	COMP_R_MOTOR_0_H			= 8,				 
	COMP_R_MOTOR_1_L			= 9,
	COMP_R_MOTOR_1_H			= 10,
	COMP_R_CHECKSUM				= 11,
	COMP_R_LENGTH				  = 12
} CompReceiveDef; // Receive data from Comp	

//typedef enum
//{
//	COMP_S_HEAD1					= 0,
//	COMP_S_HEAD2					= 1,
//	COMP_S_DIP						= 2,
//	COMP_S_MOTOR_0_L			= 3,
//	COMP_S_MOTOR_0_H			= 4,
//	COMP_S_MOTOR_1_L			= 5,
//	COMP_S_MOTOR_1_H			= 6,
//	COMP_S_MOTOR_2_L			= 7,
//	COMP_S_MOTOR_2_H			= 8,
//	COMP_S_MOTION_DONE		= 9,	
//	COMP_S_ACC_X_L				= 10,	
//	COMP_S_ACC_X_H				= 11,	
//	COMP_S_ACC_Y_L				= 12,	
//	COMP_S_ACC_Y_H				= 13,	
//	COMP_S_ACC_Z_L				= 14,	
//	COMP_S_ACC_Z_H				= 15,			
//	COMP_S_GYRO_X_L				= 16,	
//	COMP_S_GYRO_X_H				= 17,	
//	COMP_S_GYRO_Y_L				= 18,	
//	COMP_S_GYRO_Y_H				= 19,	
//	COMP_S_GYRO_Z_L				= 20,	
//	COMP_S_GYRO_Z_H				= 21,		
//	COMP_S_MAG_X_L				= 22,	
//	COMP_S_MAG_X_H				= 23,	
//	COMP_S_MAG_Y_L				= 24,	
//	COMP_S_MAG_Y_H				= 25,	
//	COMP_S_MAG_Z_L				= 26,	
//	COMP_S_MAG_Z_H				= 27,	
//	COMP_S_CHECKSUM				= 28,
//	COMP_S_LENGTH
//}	CompSendDef; // Send data to Comp

typedef enum
{
	COMP_S_HEAD1					= 0,
	COMP_S_HEAD2					= 1,
	COMP_S_DIP						= 2,
	COMP_S_MOTOR_0_L			= 3,
	COMP_S_MOTOR_0_H			= 4,
	COMP_S_MOTOR_1_L			= 5,
	COMP_S_MOTOR_1_H			= 6,
	COMP_S_MOTOR_2_L			= 7,
	COMP_S_MOTOR_2_H			= 8,
	COMP_S_MOTOR_3_L			= 9,
	COMP_S_MOTOR_3_H			= 10,
	COMP_S_MOTOR_4_L			= 11,
	COMP_S_MOTOR_4_H			= 12,
	COMP_S_MOTION_DONE		= 13,	
	COMP_S_AZIMUTH_L			= 14,	
	COMP_S_AZIMUTH_H			= 15,	
	COMP_S_CHECKSUM				= 16,
	COMP_S_LENGTH					= 17
}	CompSendDef; // Send data to Comp	






typedef struct
{
	unsigned char Buff[COMP_RX_BUFF_SIZE];
	int NowIndex;
	int EndIndex; 
} CompRXStruct;
											
void Comp_Init(void);
void Comp_Receive_Init(void);
void Comp_Send_Init(void);	 
void CompRX_Init(void);
Bool CompRX2Receive(void);
void CompSend(void);
void Receive2Motion(void);

#endif
